package com.zzjson.mvc.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2019 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.mvc</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2019年11月04日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
@RestControllerAdvice
public class RestControllerAdvicer {
	@ExceptionHandler(NullPointerException.class)
	public Object pageNotFound(HttpServletRequest request, Throwable throwable) {
		HashMap<String, Object> errors = new HashMap<>();
		errors.put("statusCode", throwable.getMessage());
		return errors;
	}


}